﻿using Company.Hardware.Acs;
using Company.Main.Views;
using Company.Share.Prism;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Company.Main
{
    public class CompanyMainModule : IModule
    {
        /// <summary>
        /// 后初始化模块
        /// </summary>
        /// <param name="containerProvider"></param>
        public void OnInitialized(IContainerProvider containerProvider)
        {
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<HomeView>(RegionNames.NavigationRegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<MotionView>(RegionNames.NavigationRegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<IOView>(RegionNames.NavigationRegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<BufferManageView>(RegionNames.NavigationRegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<TerminalCommandView>(RegionNames.NavigationRegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<SystemSettingView>(RegionNames.NavigationRegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<DigitalInputView>(RegionNames.IORegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<DigitalOutputView>(RegionNames.IORegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<LanguageComponentView>(RegionNames.NavigationRegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<AcsComponetView>(RegionNames.NavigationRegion);
            containerProvider.Resolve<IRegionManager>().RegisterViewWithRegion<SerialPortComponentView>(RegionNames.NavigationRegion);
        }
        /// <summary>
        /// 先注册
        /// </summary>
        /// <param name="containerRegistry"></param>
        /// <exception cref="NotImplementedException"></exception>
        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<MainView>();
            containerRegistry.RegisterForNavigation<HomeView>();
            containerRegistry.RegisterForNavigation<MotionView>();
            containerRegistry.RegisterForNavigation<IOView>();
            containerRegistry.RegisterForNavigation<DigitalInputView>();
            containerRegistry.RegisterForNavigation<DigitalOutputView>();
            containerRegistry.RegisterForNavigation<BufferManageView>();
            containerRegistry.RegisterForNavigation<TerminalCommandView>();
            containerRegistry.RegisterForNavigation<SystemSettingView>();
            containerRegistry.RegisterForNavigation<LanguageComponentView>();
            containerRegistry.RegisterForNavigation<AcsComponetView>();
            containerRegistry.RegisterForNavigation<SerialPortComponentView>();
        }
    }
}
